package com.hbzd.protection.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hbzd.protection.entity.GpsCarCurrentPosInfo;
import com.hbzd.protection.service.GisCarCurrentPosInfoServiceImpl;


@Controller
@RequestMapping("/gisCarCurrentPosInfo")
public class GisCarCurrentPosInfoController {
	
	@Resource
	private GisCarCurrentPosInfoServiceImpl gisCarCurrentPosInfoServiceImpl; 
	@RequestMapping("/getInfo")
	public String getInfo(String SimNum,String carNum,HttpServletRequest request, HttpServletResponse response, ModelMap modalMap) {
		GpsCarCurrentPosInfo gpsCarCurrentPosInfo = gisCarCurrentPosInfoServiceImpl.getInfo(SimNum);;
		if(gpsCarCurrentPosInfo == null){
			//如果不存在
			modalMap.put("carNum", carNum);
			modalMap.put("message", "nogis");
			return "/mycar-no";
		}else{
			modalMap.put("gpsCarCurrentPosInfo", gpsCarCurrentPosInfo);
			return "/mycar";
		}
	}
	
	
}
